const path = require('path')
// html 文件重新生成
const htmlWepackPlugin = require('html-webpack-plugin')
// 文件清理
const cleanWebpackPlugin = require('clean-webpack-plugin')
module.exports = {
    mode: 'development', // 定义开发环境
    entry: { //多入口
        app: './src/index.js',
        print: './src/print.js'
    },
    plugins: [
        new cleanWebpackPlugin(['dist']), // 参数为需要清理的文件夹
        new htmlWepackPlugin({
            title: '输出管理'
        })
    ],
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: '[name].bundle.js' //输出根据entry定义的名称来输出
    }
}